package ttOrder.dao;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import ttOrder.model.DinnerTable;
@Repository
public class ReceptionTableDAOImpl implements ReceptionTableDAO{
	
	@Autowired
	private SessionFactory sessionFactory;

	public Session getSession() {
		return this.sessionFactory.getCurrentSession();
	}
	@Override
	public List<DinnerTable> findAllleisureTable() {
		Session session = getSession();
		String hql = "from DinnerTable where TABLESTATUS = 0 ";
		@SuppressWarnings("unchecked")
		List<DinnerTable> leisuretable = session.createQuery(hql).list();
		return leisuretable;
	}

}
